<script lang="ts" setup>
  import router from './router';
  import { ref } from 'vue'
  import {
    Document,
    Menu as IconMenu,
    Location,
    Setting,
  } from '@element-plus/icons-vue'



  const isCollapse = ref(true)
  const handleOpen = (key: string, keyPath: string[]) => {
    console.log(key, keyPath)
  }
  const handleClose = (key: string, keyPath: string[]) => {
    console.log(key, keyPath)
  }
</script>

<template>
  <div class="common-layout">
    <el-container>
      <el-aside>
        <el-menu
          router
          default-active="/Base"
          class="el-menu-vertical-demo"
        >

          <el-menu-item index="/Base">
            <template #title>Day01 —— Vue 基础</template>
          </el-menu-item>

          <el-sub-menu index="/day02">
            <template #title>Day02 —— Vue 指令及事件</template>
            <el-menu-item index="/Directive1">指令与事件（上）</el-menu-item>
            <el-menu-item index="/Directive2">指令与事件（下）</el-menu-item>
          </el-sub-menu>

          <el-sub-menu index="/day3">
            <template #title>Day03 —— 组件化开发与父子通信</template>
            <el-menu-item index="/Component">组件化开发</el-menu-item>
            <el-menu-item index="/TodoList">组件通信</el-menu-item>
          </el-sub-menu>

          <el-menu-item index="/Router">
            <template #title>Day06 —— Vue-Router</template>
          </el-menu-item>

          <el-menu-item index="/Pinia">
            <template #title>Day07 —— Pinia</template>
          </el-menu-item>

          <el-menu-item index="/Ajax">
            <template #title>Day08 —— Ajax</template>
          </el-menu-item>

          <el-menu-item index="/Element">
            <template #title>Day09 —— Element Plus</template>
          </el-menu-item>
        </el-menu>

      </el-aside>
      <el-main><RouterView /></el-main>
    </el-container>
  </div>
</template>
  

<style>
.el-menu-vertical-demo:not(.el-menu--collapse) {
  width: 300px;
  min-height: 400px;
}
.el-menu-item-group__title {
  display: none;
}
</style>
